package com.lc;

import com.lc.dao.LgResumeDatasRepo;
import com.lc.pojo.LgResumeDatas;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import java.util.ArrayList;
import java.util.List;

/**
 * @author liuc
 * @date 2021/8/7
 * @description
 **/
@SpringBootApplication
public class RunBooter {
    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(RunBooter.class, args);
        LgResumeDatasRepo repo = context.getBean(LgResumeDatasRepo.class);
        List<LgResumeDatas> resumeDatas = repo.findAll();
        System.out.println(resumeDatas.size());
        List<LgResumeDatas> datas = new ArrayList<>();
        for(int i = 1; i <= 20; i++){
            LgResumeDatas d = new LgResumeDatas();
            d.setRid(i);
            d.setCity("chengdu");
            d.setName("user"+i);
            datas.add(d);
        }
        repo.saveAll(datas);
        LgResumeDatas data = repo.findByRid(1);
        System.out.println(data);
    }
}
